package com.mengyan.manage.cms.service.Impl;

import com.mengyan.framework.domain.cms.CmsSite;
import com.mengyan.framework.model.response.CommonCode;
import com.mengyan.framework.model.response.QueryResponseResult;
import com.mengyan.framework.model.response.QueryResult;
import com.mengyan.manage.cms.dao.CmsSiteRepository;
import com.mengyan.manage.cms.service.SiteService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SiteServiceImpl implements SiteService {

    @Autowired
    private CmsSiteRepository cmsSiteRepository;

    @Override
    public QueryResponseResult findList() {
        List<CmsSite> list = cmsSiteRepository.findAll();

        QueryResult queryResult = new QueryResult();
        queryResult.setList(list);
        queryResult.setTotal(list.size());
        return new QueryResponseResult(CommonCode.SUCCESS,queryResult);

    }
}
